home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Power 1997 December
/
MACPOWER-1997-12.ISO.7z
/
MACPOWER-1997-12.ISO
/
AMUG
/
PROGRAMMING
/
Raven 1.2.sit
/
Raven 1.2
/
Documents
/
FAQs
/
Why did I write Raven?
< prev
next >
Wrap
Text File
|
1997-04-12
|
4KB
|
80 lines
> I've downloaded Raven and had a short look at it. Now, I'm wondering why
> you wrote an entirely new framework. Does it do anything that
> PowerPlant, say, doesn't do, or doesn't do as good? OTOH, I didn't see
> support for the AppleEvent Object Model. Did I overlook it?).
I wrote Raven because I was frustrated with the existing application frameworks. PowerPlant has
some nice ideas but it does a poor job abstracting the toolbox, has gaps in functionality, and
has lots and lots of serious implementation problems. For example, take a look at LFile:
* The interface is written using FSSpec's. Raven's file class uses TFileSpec's and TFolderSpec's.
By using a class Raven is able to provide a nice way to get information about the file or folder
and, even more important, these classes can be relatively easily ported to a path based file
system like Rhapsody.
* LFile is missing some very basic functionality (eg getting/setting the data fork length and
seeking). This makes the class harder to use and again hampers portability because your code
winds up talking to the toolbox instead of an object.
* The LFile implementation is full of problems:
- The dtor doesn't trap exceptions so your program may abort when unwinding the stack.
- MakeAlias ignores any errors.
- ReadDataFork has a memory leak if an exception is thrown by SetFPos or FSRead. (And this
leak is the size of the file so it could be huge!)
- WriteDataFork ignores errors from SetEOF.
- None of the methods do *any* validation of the arguments.
Unfortunately these sorts of problems are present throughout PowerPlant. On the other hand,
MacApp does not have these problems. The only real problem with MacApp is that it was ported
from Object Pascal. This means it lacks the very nice mix and match style made possible with
multiple inheritance and lacked a lot of the things you'd expect in a C++ framework. (However
in the year that I've been working on Raven Apple has made great progress on turning MacApp
into a real C++ framework).
Raven does have a lot of stuff missing from PowerPlant. Here's a sample:
* Convenience classes like TPoint, TRect, TRegion, TRGBColor, and THandle. You can get by
without this sort of thing but they make the code much easier to write and to read.
* Support for animated busy cursors.
* A templatized broadcaster/listener mechanism. (Almost all the code is in non-template base
classes so the template bloat is tiny).
* A rich set of debugging macros, a framework for unit testing, and a powerful debug menu.
* A version of operator new that can use either a rewritten version of MetroWerk's fast new or
OpenDoc's BestFitHeap. The custom new provides all of DebugNew's checks and more (for example
you don't have to use NEW and when you do get a leak you get a stack crawl instead of the file
and line number).
* A nice set of sound classes.
* Flexible 2D graphing classes.
* Lots of classes to ease dealing with the file manager.
* Command objects (like MacApp's).
* Multi-level undo/redo.
* Context sensitive menus.
* More flexible event handling.
* Uses standard classes like string and STL instead of hand rolled equivalents.
* Uses the standard exception classes.
* Mouse tracker objects (like MacApp's).
* The pane classes and the view editor fully support balloon help.
* A better architecture, better class design, and a more robust implementation.
Note that the bulk of the bottom two layers of Raven can be used with PowerPlant.
However Raven is still missing some important things. I think the biggest are scripting support,
printing, and the weak support for custom pane types in the view editor.